package com.wl.application.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author wl
 * @version 1.0
 * @date 2022/6/14
 * @description:
 */
@Component
public class MyPageConfig {



    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        //设置一个拦截器
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //给该拦截器设置分页拦截 设置mysql的拦截
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
